-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
generate-git-snapshot: explicitly set git-export-dir when building with enabled overlay option #231
base: master
Are you sure you want to change the base?
Conversation
The package that I built from source to perform a test was skalibs (https://salsa.debian.org/zhsj/skalibs.git) The source build appears to produce the goods, and a successful binary build follows, although I have some doubts. The logs are being spammed with warnings I suspect that this is because only the debian directory is present when dpkg-source is called i.e. the overlay is not active. This means that patches cannot be applied/unapplied by dpkg-source, since the upstream source isn't present. AFAIK the build directory with the overlay is deleted after the orig.tar.gz has been created by gbp buildpackage. I can think of two ways that that might resolve this:
|
…hen building with enabled overlay option If debian/gbp.conf contains something like: | [buildpackage] | overlay = True | export-dir = ../build-area then invoking gbp with our default $GBP_OPTS will fail with: | gbp:error: Overlay must be used with --git-export-dir. To avoid running into this, let's check for the overlay option, and if it's enabled then explicitly set --git-export-dir= to '--git-export-dir=../' to generate the orig.tar.* files at the expected place. On Debian/jessie `gbp config buildpackage.overlay` reports something like: | buildpackage.overlay=False while on newer systems, `gbp config buildpackage.overlay` reports: | False So the check only grep's for "True". JFTR, we are *not* setting --git-export-dir=../ by default, as this involves some further operations going on, which might be unexpected in existing installations where the overlay feature isn't present/enabled. See e.g.: | % gbp buildpackage -nc --git-force-create --git-ignore-new --git-ignore-branch -S -us -uc --git-verbose --git-builder=/bin/true --git-cleaner=/bin/true --git-export-dir= | gbp:debug: ['git', 'rev-parse', '--show-cdup'] | gbp:debug: ['git', 'rev-parse', '--is-bare-repository'] | gbp:debug: /bin/true [] [] | gbp:debug: ['git', 'symbolic-ref', 'HEAD'] | gbp:debug: ['git', 'show-ref', 'refs/heads/debian'] | gbp:debug: ['git', 'show-ref', 'refs/heads/pristine-tar'] | gbp:debug: ['git', 'ls-tree', 'upstream/5.8'] | gbp:info: zsh_5.8.orig.tar.gz does not exist, creating from 'upstream/5.8' | gbp:debug: Building upstream tarball with compression 'gzip -9' | gbp:debug: /bin/true ['-nc', '-S', '-us', '-uc'] [] vs: | % gbp buildpackage -nc --git-force-create --git-ignore-new --git-ignore-branch -S -us -uc --git-verbose --git-builder=/bin/true --git-cleaner=/bin/true --git-export-dir=../ | gbp:debug: ['git', 'rev-parse', '--show-cdup'] | gbp:debug: ['git', 'rev-parse', '--is-bare-repository'] | gbp:debug: /bin/true [] [] | gbp:debug: ['git', 'symbolic-ref', 'HEAD'] | gbp:debug: ['git', 'show-ref', 'refs/heads/debian'] | gbp:debug: ['git', 'ls-tree', 'HEAD'] | gbp:debug: ['git', 'show', '--pretty=medium', 'HEAD:debian/source/format'] | gbp:debug: ['git', 'show', '--pretty=medium', 'HEAD:debian/changelog'] | gbp:debug: ['git', 'show-ref', 'refs/heads/pristine-tar'] | gbp:debug: ['git', 'ls-tree', 'upstream/5.8'] | gbp:info: zsh_5.8.orig.tar.gz does not exist, creating from 'upstream/5.8' | gbp:debug: Building upstream tarball with compression 'gzip -9' | gbp:info: Exporting 'HEAD' to '/home/buildd/zsh-tmp' | gbp:debug: ['git', 'show', '--pretty=medium', 'HEAD:debian/source/format'] | gbp:info: Moving '/home/buildd/zsh-tmp' to '/home/buildd/zsh-5.8' | gbp:debug: ['git', 'show', '--pretty=medium', 'HEAD:debian/source/format'] | gbp:debug: /bin/true ['-nc', '-S', '-us', '-uc'] [] | gbp:debug: rm ['-rf', '/home/buildd/zsh-5.8'] [] Thanks: Guido Günther and Andrew Harle for feedback Closes: #230
If debian/gbp.conf contains something like:
| [buildpackage]
| overlay = True
| export-dir = ../build-area
then invoking gbp with our default $GBP_OPTS then it will fail with:
| gbp:error: Overlay must be used with --git-export-dir.
To avoid running into this, let's check for the overlay option,
and if it's enabled then explicitly set --git-export-dir= to '--git-export-dir=../'
to generate the orig.tar.* files at the expected place.
JFTR, we are not setting --git-export-dir=../ by default, as this
involves some further operations going on, which might be unexpected
in existing installations where the overlay feature isn't present/enabled.
See e.g.:
| % gbp buildpackage -nc --git-force-create --git-ignore-new --git-ignore-branch -S -us -uc --git-verbose --git-builder=/bin/true --git-cleaner=/bin/true --git-export-dir=
| gbp:debug: ['git', 'rev-parse', '--show-cdup']
| gbp:debug: ['git', 'rev-parse', '--is-bare-repository']
| gbp:debug: /bin/true [] []
| gbp:debug: ['git', 'symbolic-ref', 'HEAD']
| gbp:debug: ['git', 'show-ref', 'refs/heads/debian']
| gbp:debug: ['git', 'show-ref', 'refs/heads/pristine-tar']
| gbp:debug: ['git', 'ls-tree', 'upstream/5.8']
| gbp:info: zsh_5.8.orig.tar.gz does not exist, creating from 'upstream/5.8'
| gbp:debug: Building upstream tarball with compression 'gzip -9'
| gbp:debug: /bin/true ['-nc', '-S', '-us', '-uc'] []
vs:
| % gbp buildpackage -nc --git-force-create --git-ignore-new --git-ignore-branch -S -us -uc --git-verbose --git-builder=/bin/true --git-cleaner=/bin/true --git-export-dir=../
| gbp:debug: ['git', 'rev-parse', '--show-cdup']
| gbp:debug: ['git', 'rev-parse', '--is-bare-repository']
| gbp:debug: /bin/true [] []
| gbp:debug: ['git', 'symbolic-ref', 'HEAD']
| gbp:debug: ['git', 'show-ref', 'refs/heads/debian']
| gbp:debug: ['git', 'ls-tree', 'HEAD']
| gbp:debug: ['git', 'show', '--pretty=medium', 'HEAD:debian/source/format']
| gbp:debug: ['git', 'show', '--pretty=medium', 'HEAD:debian/changelog']
| gbp:debug: ['git', 'show-ref', 'refs/heads/pristine-tar']
| gbp:debug: ['git', 'ls-tree', 'upstream/5.8']
| gbp:info: zsh_5.8.orig.tar.gz does not exist, creating from 'upstream/5.8'
| gbp:debug: Building upstream tarball with compression 'gzip -9'
| gbp:info: Exporting 'HEAD' to '/home/buildd/zsh-tmp'
| gbp:debug: ['git', 'show', '--pretty=medium', 'HEAD:debian/source/format']
| gbp:info: Moving '/home/buildd/zsh-tmp' to '/home/buildd/zsh-5.8'
| gbp:debug: ['git', 'show', '--pretty=medium', 'HEAD:debian/source/format']
| gbp:debug: /bin/true ['-nc', '-S', '-us', '-uc'] []
| gbp:debug: rm ['-rf', '/home/buildd/zsh-5.8'] []
Thanks: Guido Günther for feedback
Closes: #230